<template>
  <div class="scheme_list" v-loading="state.schemeloading">
    <el-scrollbar height="100%">
      <div class="list">
        <SchemeItem
          v-for="(item, index) in state.schemeList"
          :index="index"
          :data="item"
          :key="item.scheme_code" @click="store.changeschemeActive(item)" :style="state.schemeActive.scheme_code == item.scheme_code ? 'background-color: #fff4ec;' : ''"
        />
      </div>
    </el-scrollbar>
  </div>
</template>

<script setup>
import SchemeItem from './components/SchemeItem.vue'

const { store, state } = inject('Home')

const chxd = ref({
  scheme_name: '自主方案', 
  filter_name: '出货下单',
  scheme_code: 'chxd'
  })
</script>

<style lang="scss" scoped>
.scheme_list {
  height: 100%;
  width: 240px;
}
.list {
  width: calc(240px - 8px);
  height: 100%;
  background: #fff;
  border: solid 1px #ebebeb;
  display: flex;
  flex-direction: column;
}
</style>

<style>
.scheme_list .el-scrollbar__view {
  height: 100%;
}
</style>